<?php
//Connection statement
require_once('../Connections/cn.php');

//Aditional Functions
require_once('../includes/functions.inc.php');

// Load the common classes
require_once('../includes/common/KT_common.php');

// Load the required classes
require_once('../includes/tfi/TFI.php');
require_once('../includes/tso/TSO.php');
require_once('../includes/nav/NAV.php');

// Filter
$tfi_listeditorial1 = new TFI_TableFilter($cn, "tfi_listeditorial1");
$tfi_listeditorial1->addColumn("editorial.nombre_editorial", "STRING_TYPE", "nombre_editorial", "%");
$tfi_listeditorial1->Execute();

// Sorter
$tso_listeditorial1 = new TSO_TableSorter("rseditorial1", "tso_listeditorial1");
$tso_listeditorial1->addColumn("editorial.nombre_editorial");
$tso_listeditorial1->setDefault("editorial.nombre_editorial");
$tso_listeditorial1->Execute();

// Navigation
$nav_listeditorial1 = new NAV_Regular("nav_listeditorial1", "rseditorial1", "../", $_SERVER['PHP_SELF'], 10);

// Begin List Recordset
$maxRows_rseditorial1 = $_SESSION['max_rows_nav_listeditorial1'];
$pageNum_rseditorial1 = 0;
if (isset($_GET['pageNum_rseditorial1'])) {
  $pageNum_rseditorial1 = $_GET['pageNum_rseditorial1'];
}
$startRow_rseditorial1 = $pageNum_rseditorial1 * $maxRows_rseditorial1;
$NXTFilter__rseditorial1 = '1=1';
if (isset($_SESSION['filter_tfi_listeditorial1'])) {
  $NXTFilter__rseditorial1 = $_SESSION['filter_tfi_listeditorial1'];
}
$NXTSort__rseditorial1 = 'editorial.nombre_editorial';
if (isset($_SESSION['sorter_tso_listeditorial1'])) {
  $NXTSort__rseditorial1 = $_SESSION['sorter_tso_listeditorial1'];
}
$query_rseditorial1 = sprintf("SELECT editorial.nombre_editorial, editorial.id_editorial FROM editorial WHERE %s ORDER BY %s", $NXTFilter__rseditorial1, $NXTSort__rseditorial1);
$rseditorial1 = $cn->SelectLimit($query_rseditorial1, $maxRows_rseditorial1, $startRow_rseditorial1) or die($cn->ErrorMsg());
if (isset($_GET['totalRows_rseditorial1'])) {
  $totalRows_rseditorial1 = $_GET['totalRows_rseditorial1'];
} else {
  $all_rseditorial1 = $cn->SelectLimit($query_rseditorial1) or die($cn->ErrorMsg());
  $totalRows_rseditorial1 = $all_rseditorial1->RecordCount();
}
$totalPages_rseditorial1 = (int)(($totalRows_rseditorial1-1)/$maxRows_rseditorial1);
// End List Recordset

$nav_listeditorial1->checkBoundries();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php //PHP ADODB document - made with PHAkt 3.6.0?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" />
<script src="../includes/common/js/base.js" type="text/javascript"></script>
<script src="../includes/common/js/utility.js" type="text/javascript"></script>
<script src="../includes/skins/style.js" type="text/javascript"></script>
<script src="../includes/nxt/scripts/list.js" type="text/javascript"></script>
<script src="../includes/nxt/scripts/list.js.php" type="text/javascript"></script>
<script type="text/javascript">
$NXT_LIST_SETTINGS = {
  duplicate_buttons: false,
  duplicate_navigation: false,
  row_effects: true,
  show_as_buttons: false,
  record_counter: false
}
</script>
<style type="text/css">
  /* NeXTensio3 List row settings */
  .KT_col_nombre_editorial {width:140px; overflow:hidden;}
</style>
</head>

<body>
<div class="KT_tng" id="listeditorial1">
  <h1> Editorial
    <?php
  $nav_listeditorial1->Prepare();
  require("../includes/nav/NAV_Text_Statistics.inc.php");
?>
  </h1>
  <div class="KT_tnglist">
    <form action="<?php echo KT_escapeAttribute(KT_getFullUri()); ?>" method="post" id="form1">
      <div class="KT_options"> <a href="<?php echo $nav_listeditorial1->getShowAllLink(); ?>"><?php echo NXT_getResource("Show"); ?>
        <?php 
  // Show IF Conditional region1 
  if (@$_GET['show_all_nav_listeditorial1'] == 1) {
?>
          <?php echo $_SESSION['default_max_rows_nav_listeditorial1']; ?>
          <?php 
  // else Conditional region1
  } else { ?>
          <?php echo NXT_getResource("all"); ?>
          <?php } 
  // endif Conditional region1
?>
            <?php echo NXT_getResource("records"); ?></a> &nbsp;
        &nbsp;
                            <?php 
  // Show IF Conditional region2 
  if (@$_SESSION['has_filter_tfi_listeditorial1'] == 1) {
?>
                              <a href="<?php echo $tfi_listeditorial1->getResetFilterLink(); ?>"><?php echo NXT_getResource("Reset filter"); ?></a>
                              <?php 
  // else Conditional region2
  } else { ?>
                              <a href="<?php echo $tfi_listeditorial1->getShowFilterLink(); ?>"><?php echo NXT_getResource("Show filter"); ?></a>
                              <?php } 
  // endif Conditional region2
?>
      </div>
      <table cellpadding="2" cellspacing="0" class="KT_tngtable">
        <thead>
          <tr class="KT_row_order">
            <th> <input type="checkbox" name="KT_selAll" id="KT_selAll"/>
            </th>
            <th id="nombre_editorial" class="KT_sorter KT_col_nombre_editorial <?php echo $tso_listeditorial1->getSortIcon('editorial.nombre_editorial'); ?>"> <a href="<?php echo $tso_listeditorial1->getSortLink('editorial.nombre_editorial'); ?>">Nombre editorial</a> </th>
            <th>&nbsp;</th>
          </tr>
          <?php 
  // Show IF Conditional region3 
  if (@$_SESSION['has_filter_tfi_listeditorial1'] == 1) {
?>
            <tr class="KT_row_filter">
              <td>&nbsp;</td>
              <td><input type="text" name="tfi_listeditorial1_nombre_editorial" id="tfi_listeditorial1_nombre_editorial" value="<?php echo KT_escapeAttribute(@$_SESSION['tfi_listeditorial1_nombre_editorial']); ?>" size="20" maxlength="255" /></td>
              <td><input type="submit" name="tfi_listeditorial1" value="<?php echo NXT_getResource("Filter"); ?>" /></td>
            </tr>
            <?php } 
  // endif Conditional region3
?>
        </thead>
        <tbody>
          <?php if ($totalRows_rseditorial1 == 0) { // Show if recordset empty ?>
            <tr>
              <td colspan="3"><?php echo NXT_getResource("The table is empty or the filter you've selected is too restrictive."); ?></td>
            </tr>
            <?php } // Show if recordset empty ?>
          <?php if ($totalRows_rseditorial1 > 0) { // Show if recordset not empty ?>
            <?php
  while (!$rseditorial1->EOF) { 
?>
              <tr class="<?php echo @$cnt1++%2==0 ? "" : "KT_even"; ?>">
                <td><input type="checkbox" name="kt_pk_editorial" class="id_checkbox" value="<?php echo $rseditorial1->Fields('id_editorial'); ?>" />
                    <input type="hidden" name="id_editorial" class="id_field" value="<?php echo $rseditorial1->Fields('id_editorial'); ?>" />
                </td>
                <td><div class="KT_col_nombre_editorial"><?php echo KT_FormatForList($rseditorial1->Fields('nombre_editorial'), 20); ?></div></td>
                <td><a class="KT_edit_link" href="?mod=editorial&amp;id_editorial=<?php echo $rseditorial1->Fields('id_editorial'); ?>&amp;KT_back=1"><?php echo NXT_getResource("edit_one"); ?></a> <a class="KT_delete_link" href="#delete"><?php echo NXT_getResource("delete_one"); ?></a> </td>
              </tr>
              <?php
    $rseditorial1->MoveNext(); 
  }
?>
            <?php } // Show if recordset not empty ?>
        </tbody>
      </table>
      <div class="KT_bottomnav">
        <div>
          <?php
            $nav_listeditorial1->Prepare();
            require("../includes/nav/NAV_Text_Navigation.inc.php");
          ?>
        </div>
      </div>
      <div class="KT_bottombuttons">
        <div class="KT_operations"> <a class="KT_edit_op_link" href="#" onclick="nxt_list_edit_link_form(this); return false;"><?php echo NXT_getResource("edit_all"); ?></a> <a class="KT_delete_op_link" href="#" onclick="nxt_list_delete_link_form(this); return false;"><?php echo NXT_getResource("delete_all"); ?></a> </div>
<span>&nbsp;</span>
        <select name="no_new" id="no_new">
          <option value="1">1</option>
          <option value="3">3</option>
          <option value="6">6</option>
        </select>
        <a class="KT_additem_op_link" href="?mod=editorial&amp;KT_back=1" onclick="return nxt_list_additem(this)"><?php echo NXT_getResource("add new"); ?></a> </div>
    </form>
  </div>
  <br class="clearfixplain" />
</div>
<p>&nbsp;</p>
</body>
</html>
<?php
$rseditorial1->Close();
?>
